<?php
namespace common\modules\content\models\query;

use common\modules\content\models\Article;
use yii\db\ActiveQuery;

/**
 * This is the ActiveQuery class for [[\common\modules\content\models\Article]].
 *
 * @see \common\modules\content\models\Article
 */
class ArticleQuery extends ActiveQuery
{

    public function published()
    {
        $this->andWhere([
            'status' => Article::STATUS_PUBLISHED
        ]);
        $this->andWhere([
            '<',
            '{{%article}}.published_at',
            time()
        ]);
        return $this;
    }
}
